<?php
class MenuController extends AppController {
    var $name = 'menu';

    var $pageTitle = '';

    var $viewPath = 'utilities/menu';

    function display() {
        // params['form'] => 'its_return', 'customer_report', ...
        list($prefix, $menu) = split('_', $this->params['form']['menuId'], 2);
        
        switch ($prefix) {
            case 'its': $this->viewPath = 'utilities/menu/its'; break;
            case 'customer': $this->viewPath = 'utilities/menu/customers'; break;
            case 'supplier': $this->viewPath = 'utilities/menu/suppliers'; break;
        }
        
        $this->render($menu);
    }

}
?>
